# README for the replication of the article titled "Measuring legislative stability - A new approach with data from Hungary". 
 
The repository contains a replication of the analysis included in the article with two given input datasets. 

###########################
# Sources of data
###########################

Two datasets are included in the repository as the replication script's input. These files are: "cap_laws_torvcikk_final.xlsx" and "network_db_final.txt". They can be found in the "/DATA" folder. 

The dataset "network_db_final.txt" originally contained the network of law amendments with related metadata to each amendment pair (edges of the directed graph). First, under the Comparative Agendas Project, all law texts were collected in the timespan of analysis with related metadata. Then, through string matching techniques we created the directed network of law amendments. The dataset was then narrowed down to the following five variables:
(1-2) "source" and "target" --> title of original (target) and amending (source) law
(3) "passed_difference" --> number of days between passage of source and target law
(4) "source_cycle" --> the election cycle in which the source was present, based on date of passage
(5) "target_cycle" --> the election cycle in which the target was present, based on date of passage

The table "cap_laws_torvcikk_final.xlsx" lists all the target laws in the networks (target nodes of the directed amendment graph) with their related metadata. The source of the dataset is also a result of the Comparative Agendas Project.
(1) "id_new" --> title of source law
(2) "modifications_sum" --> number of all modifications on the target law
(3) "majortopic" --> 21 categories of CAP-coded polity topics (see Comparative Agendas Project)
(4) "electoral_cycle" --> the electoral cycle in which the target law was passed
(5) "cabinet" --> the cabinet in which the target law was passed
(6) "international" --> whether the target law was related to internationalized issues
(7) "introducer_type" --> whether the introducer was an MP or a government institution
(8) "pass_lenght_day" --> number of days between passage of source and target law
(9) "law_length_pages" --> number of pages in the target law
(10) "government_reps" --> number of MPs member of a governing party at the time of passage of target law
(11) "total_reps" --> total number of MPs at the time of passage of target law
(12) "law_type_majority" --> whether the target law required a simple majority for passage
(13) "vote_yes_majority" --> number of yes votes in simple majority voting
(14) "vote_total_majority" --> number of total votes in simple majority voting
(15) "law_type_supermajority" --> whether the target law required a supermajority for passage
(16) "vote_yes_supermajority" --> number of yes votes in supermajority voting
(17) "vote_total_supermajority" --> number of total votes in supermajority voting

###########################
# System specifications for replication
###########################

The replication of the analysis has been tested to run under the following environment:
1)  8 GBs of available RAM
2)  Windows 10
3)  STATA version 13.0

###########################
# Listing of all figures and tables
###########################

The steps and script of the reproduction can be found in the SATA13 .do file "analysis.do" in the "/Scripts/" folder. 

When run, the script exports the relevant tables into .xlsx or .csv format into either the "REGRESSION_TABLES" folder (when the table describes regression results) or the "OTHER_TABLES" folder (in all other cases). Furthermore, it exports the figures into .png format into the "FIGURES" folder. 
All lines which export the said results are preceded by either "TABLE #" or  "FIGURE #" where the # stands for the serial number. We highlight the cases of tables which were not produced by the reproduction script by adding a * after the serial number.

IMPORTANT: For succesful reproduction and exporting, please download the entire directory of the repository or recreate the directory structure with such folders existing as named above.


Figure 1:
Based on the dataset containing original laws and their amendment(s), we calculated the number of calendar days between the adoption of the original bill and those of its respective amendment(s). The distribution of the values for the complete dataset is presented in Figure 1 in a histogram.

Figure 2:
Figure 2 shows the distribution of the legislative life of laws adopted in different terms of government.

Figure 3:
Figure 3 shows the distribution over time of amendments within the same term.

Figure 4:
Figure 4 illustrates the distributions of the timespan between the adoption of the amendment and the amended law that characterise each term.

Figure 5:
In our research, we introduced the Legislative Stability Index (LSI), which is the sum of modifications over a given law in its first adopted form. Figure 5 presents the distribution of LSI values.

Figure 6:
In Figure 6 we show the cumulative distribution of intra-term and over-term amendments over two consecutive terms (in which cases the adoption of the amended law is within a term directly preceding the adoption of the amendment law). 

Table 1*: 
Amendment-type connections refer to provisions that either amend or repeal certain provisions in the given law. We compiled our dictionary based on Decree 61/2009 (XII.14) of the Ministry of Justice and Law Enforcement on the Drafting of Legal Statutes. Table 1 lists the keywords and expressions used by our algorithm to recognize such connections in the texts of the laws. 

Table 2:
Table 2 presents the results for the parameter estimation for the LSI with four different model specifications. Model 1 investigated how legal stability is influenced by the core set of explanatory variables: the legislative term, the length of time it takes to adopt a bill, and the length of the law. Model 2 augmented the basic model with two explanatory variables, the ideological orientation of the government and the method of adoption. Model 3 and 4 expanded the analysis by two further politics-related variables: the sponsor of the bill (individual MP or the government) and the ratio of yes votes as a share of the total votes cast on the bill.

Table 3*: In Table 3 we included all hypotheses and qualitatively evaluated results from regression Table 2.

Table 4:
Table 4 summarizes our results of LSI values broken down by terms.

Table 5*:
In Table 5 the reader can find examples for amendments with substantive content, cosmetic amendments and mixed amendments containing both substantive and cosmetic elements translated to English

Appendix 1 - Table A1: To validate our analysis on a more robust ground we included double-term election cycle categorical variables in the same regressions as in our primer analysis. Table 5 contains every original model included in Table 2 paired with double-term election cycle categorical variables.

Appendix 2 - Table A2*: In Table A2 the reader can find examples for amendments with substantive content, cosmetic amendments and mixed amendments containing both substantive and cosmetic elements in original Hungarian.
